package com.glela.live.service.impl;

import com.glela.live.mapper.LiveRecFileMapper;
import com.glela.live.model.LiveRecFile;
import com.glela.live.service.LiveRecFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LiveRecFileServiceImpl implements LiveRecFileService{

    @Autowired
    private LiveRecFileMapper liveRecFileMapper;

    @Override
    public int add(LiveRecFile liveRecFile) {
//        LiveRecord liveRecord = liveRecordMapper.getLastRecord(Long.valueOf(liveRecFile.getStream()));
        //根据直播房间号查询开始时间在liveplan开始结束时间之内的记录或开始时间在直播开始时间之后正在直播中的记录
//        String livePlanId = redisUtil.get(RedisKeys.LIVE_ROOM_EXECUT_LIVE_PLAN+liveRecFile.getStream());
        /*if (livePlanId==null){
            LivePlan livePlan = livePlanMapper.getByStartTime(Integer.valueOf(liveRecFile.getStream()), DateUtil.toDate(liveRecFile.getStartTime()));
            if (livePlan!=null){
                livePlanId = livePlan.getId()+"";
            }
        }
        liveRecFile.setLivePlanId(livePlanId==null?0:Integer.valueOf(livePlanId));*/
        return liveRecFileMapper.add(liveRecFile);
    }
}
